<?php

/**
 * @author 陈韵
 * stock100
 */
namespace App\Service\OrderService\OrderRouteService;
use App\Service\Code\Normal;
use App\Service\VendorClient\ShopStock100\ShopStock100Client;
use App\Service\OrderService\BaseSupplierRouterService;
use App\Model\PssModel\PddToken;
use function GuzzleHttp\json_decode;
use App\Model\PssModel\OrderPullLog;
class ShopStock100 extends BaseSupplierRouterService
{
    /**
     * 创建订单
     * @param array $param
     * @return mixed
     */
    public function createOrder( $param = [] )
    {
        return Normal::returnCode(Normal::SUC,"处理完成");
    }

    /**
     * 订单支付
     * @param array $param
     * @return mixed
     */
    public function orderPay( $param = [] )
    {
        return Normal::returnCode(Normal::SUC,"处理完成");
    }
    
    /**
     * 订单取消
     * @param array $param
     * @return mixed
     */
    public function orderCancel( $param = [] )
    {
        return Normal::returnCode(Normal::SUC,"处理完成");
    }
    
    /**
     * 订单售后
     * @param array $param
     * @return mixed
     */
    public function orderAfterSale($param = [])
    {
        $shop     = PddToken::instance()->info(['bid' => $param["binfo"]["bid"]]);
        $extends  = json_decode($shop["extends"],true);
        $orderLog = OrderPullLog::instance()->info(['order_sn' => $param["order"]["orderSn"]]);
        $param["apiBody"]=$extends;
        $param["orderLog"]=json_decode($orderLog["contents"],true);
        return $this->callSdkApi(ShopStock100Client::class,$param['apiBody'])->cancelOrder($param);
    }
    
    
    /**
     * 商品列表查询接口
     * @param array $param
     */
    public function queryGoodsList( $param = [] )
    {
        
        return Normal::returnCode(Normal::SUC,"处理完成");
    }
}